﻿<%@ Page Title="Reporting" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Report.aspx.vb" Inherits="WRDBWeb.Report" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>
<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
    <section class="featured">
        <div class="content-wrapper">
            <table style="width: 100%">
                <tr>
                    <td>
                        <hgroup class="title">
                            <h1><%: Title %> </h1>
                            <h2><asp:Label ID="lblInfo" runat="server" Text="A total of ? records are selected and available for reporting." meta:resourcekey="lblInfoResource1"></asp:Label></h2>
                        </hgroup>
                    </td>
                    <td>
                        <asp:Image ID="Image1" runat="server" ImageAlign="Right" ImageUrl="~/Images/RSReport_32xLG.png" meta:resourcekey="Image1Resource1" />
                    </td>
                </tr>
            </table>
        </div>
     </section>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <script>
        //$(document).ready(function () {
        //    //convert to fancy radio buttons
        //    //$("input[type=radio]").each(function () { $(this).button(); });

        //    //see if hidden field was set to indicate that parameter dialog should be displayed
        //    if ($("[id$='hdnShowParms']").val() == "true") showDialogParms();

        //    $("#divProgress").progressbar({
        //        value: false //not supported in this version (indeterminate)
        //    });

        //});
    </script>

    <script>
        //this method requires that the page contain a div called divDialogProgress that looks like this:
        //        <div id="divDialogProgress" title="Please stand by..." style="display:none">
        //          <div id="divProgress"></div>
        //        </div>
        //Will also need the GetResource pagemethod in codebehind
        //It should be called after a button is clicked using OnClientClicked="showProgress(); return true;"

        //Was changed to pnlDialogProgress so can reference from code-behind

        //6/11/15--the progress form does not reliably go away; remove it
        //var dlg;

        //function showProgress() {
        //    $("#divProgress").progressbar({
        //        value: false //indeterminate
        //    });

        //    PageMethods.GetResource("ProgressTitle", function (res) {
        //        $("[id$='pnlDialogProgress']").attr("title", res);
        //        dlg = $("[id$='pnlDialogProgress']").dialog({
        //            modal: true,
        //            width: 300,
        //            height: 100,
        //            resizable: false,
        //            draggable: false,
        //            closeOnEscape: false,
        //            close: function () {$(this).dialog('destroy').remove()} //the dialogs kept getting added and eventually would not close properly (maybe because placed in panel instead of div); this seems to fix it
        //        })
        //    })

        //};

        //function hideProgress() {
        //    if (dlg) if (dlg.dialog("isOpen")==true) dlg.dialog("close");
        //};
    </script>

    <asp:UpdatePanel runat="server" ID="UpdatePanel1">
        <ContentTemplate>
            <table style="width:100%">
                <tr>
                    <td style="width:1px; white-space:nowrap">
                        <asp:Label ID="lblReports" runat="server" meta:resourcekey="lblReportsResource1" Style="margin-right:0.5em; white-space:nowrap; vertical-align:middle" Text="Select report:"></asp:Label>
                    </td>
                    <td style="width:100%; white-space:nowrap">
                        <asp:DropDownList ID="cboReports" runat="server" meta:resourcekey="cboReportsResource1" style="width: 100%" ToolTip="Select from list of previously created reports." Width="100%">
                        </asp:DropDownList>
                    </td>
                    <td style="width:1em">
                    </td>
                    <td style="width:1px; white-space:nowrap">
<%--                        <asp:Button ID="btnReports" runat="server" meta:resourcekey="btnReportsResource1" OnClientClick="showProgress(); return true;" Text="Run Report" ToolTip="Display the selected report below." />--%>
                        <asp:Button ID="btnReports" runat="server" meta:resourcekey="btnReportsResource1" OnClientClick="return true;" Text="Run Report" ToolTip="Display the selected report below." />
                    </td>
                </tr>
            </table>
            <div>
                <hr />
                <rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="100%" BorderStyle="Solid" BorderWidth="1px" SizeToReportContent="True" Font-Names="Verdana" Font-Size="8pt" meta:resourcekey="ReportViewer1Resource1" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Visible="True"></rsweb:ReportViewer>
            </div>

            <div id="divInstructions" style="display: normal" runat="server">
                <table align="center">
                    <tr>
                        <td style="width: 800px; height: 300px; text-align: center; vertical-align: middle">
                            <p>
                                <asp:Label ID="lblInstructions" runat="server" Font-Italic="True" Font-Size="Large" EnableViewState="False" meta:resourcekey="lblInstructionsResource1"></asp:Label>
                            </p>
                        </td>
                    </tr>
                </table>
            </div>

            <%--the following div will contain the dynamically created controls needed for some reports which include parameters that must be set--%>
            <asp:Panel ID="pnlParameters" runat="server" Style="display: none; font-size: .85em" meta:resourcekey="pnlParametersResource1" DefaultButton="btnRefresh">
                <asp:Table ID="tblParms" runat="server" Width="100%">
                </asp:Table>
                <%--separate div for OK/Cancel buttons; add margin above so there is room for calendar popups--%>
                <div style="display:block;float:right">
<%--                    <asp:Button ID="btnRefresh" runat="server" Text="Refresh" OnClientClick="$('#divDialogParms').dialog('close'); showProgress(); return true" Style="margin-left: 1em; margin-top: 150px; margin-bottom: 20px" meta:resourcekey="btnRefreshResource1" />--%>
                    <asp:Button ID="btnRefresh" runat="server" Text="Refresh" OnClientClick="$('#divDialogParms').dialog('close'); return true" Style="margin-left: 1em; margin-top: 150px; margin-bottom: 20px" meta:resourcekey="btnRefreshResource1" />
                    <asp:Button ID="btnCancel"  runat="server" Text="Cancel"  OnClientClick="$('#divDialogParms').dialog('close'); return true" Style="margin-left: 1em; margin-top: 150px; margin-bottom: 20px" meta:resourcekey="btnCancelResource1" />
                </div>

            </asp:Panel>

<%--             <asp:Panel ID="pnlDialogProgress" runat="server" Style="display: none">
                 <div id="divProgress"></div>
             </asp:Panel>
--%>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>


